﻿<%@ Page Language="C#" ValidateRequest="false" EnableEventValidation="false" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="DocVenta.aspx.cs" Inherits="CROSLAND.WebApp.DocVenta" Title="Crystalis Consulting" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register assembly="IdeaSparx.CoolControls.Web" namespace="IdeaSparx.CoolControls.Web" tagprefix="cc2" %>
<%@ Register src="UserControl/PagoControl.ascx" tagname="PagoControl" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphHeader" runat="server"></asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="cphTopMenu" runat="server">
    
    <script type="text/javascript">
        function mostrarImpresion() {

            $find("mpeImpresion").show();
        }

        function abrirImpresionDocumento(opcion) {
            window.open(opcion, '', 'width=840,height=750,top=50,left=150,status=no,resizable=no,scrollbars=yes');
            return false;
        }

        function cerrarDialogoImpresion() {
            $find("mpeImpresion").hide();
        }
    
    </script>

    <asp:UpdatePanel ID="upBotones" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
        <ContentTemplate>
            <%--<script type="text/javascript">
                function fnDisable(object) {
                    object.disabled = 1;
                    var cancelBtn = document.getElementById("<%= btnCancelProvider.ClientID %>");
                    cancelBtn.disabled = 1;
                    return true;
                }
            </script>--%>
            <asp:ImageButton ID="btnCrear" runat="server" ImageUrl="~/img/new.png" AlternateText="Crear doc ventas" ToolTip="Crear doc ventas" onclick="btnCrear_Click" />&nbsp;
            <asp:ImageButton ID="btnEditar" runat="server" ImageUrl="~/img/edit.png" AlternateText="Modificar doc ventas" ToolTip="Modificar doc ventas" onclick="btnEditar_Click" />&nbsp;
            <asp:ImageButton ID="btnVisualizar" runat="server" ImageUrl="~/img/view.png" AlternateText="Visualizar doc ventas" ToolTip="Visualizar doc ventas" onclick="btnVisualizar_Click" />&nbsp;       
            <asp:ImageButton ID="btnImprimir" runat="server" ImageUrl="~/img/print.png" AlternateText="Imprimir doc ventas" ToolTip="Imprimir doc ventas"  />&nbsp;
            <asp:ImageButton ID="btnFlujo" runat="server" ImageUrl="~/img/flujo.png" AlternateText="Visual. flujo doc ventas" ToolTip="Visual. flujo doc ventas" onclick="btnFlujo_Click" />&nbsp;
            <asp:ImageButton ID="btnActualizar" runat="server" ImageUrl="~/img/update.dis.png" AlternateText="Recalcular Totales" ToolTip="Recalcular Totales" OnClick="btnActualizar_Click" />&nbsp;
            <asp:ImageButton ID="btnGrabar" runat="server" ImageUrl="~/img/save.dis.png" Visible="true" AlternateText="Grabar doc ventas" ToolTip="Grabar doc ventas" OnClick="btnGrabar_Click" />&nbsp;
            <asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/img/cancel.dis.png" AlternateText="Cancelar" ToolTip="Cancelar operación" Enabled="false" OnClick="btnCancel_Click" />&nbsp;
            <asp:ImageButton ID="btnFacturar" runat="server" ImageUrl="~/img/facturar.png" AlternateText="Facturar" ToolTip="Facturar operación" Enabled="true" OnClick="btnFacturar_Click" />&nbsp;
            <asp:ImageButton ID="btnReenumerar" runat="server" ImageUrl="~/img/reenumerar.png" AlternateText="Reenumerar" ToolTip="Reenumerar" Enabled="true" OnClick="btnReenumerar_Click" />&nbsp;
            <asp:ImageButton ID="btnImpCierre" runat="server" ImageUrl="~/img/repcierre.gif" AlternateText="Reporte de Cierre caja" ToolTip="Reporte de Cierre caja" Enabled="true" OnClick="btnRepCierreCaja_Click" />&nbsp;
            <asp:ImageButton ID="btnCierreCaja" runat="server" ImageUrl="~/img/cierre.gif" AlternateText="Cierre caja" ToolTip="Cierre caja" Enabled="true" OnClick="btnCierreCaja_Click" />&nbsp;


        


            
        </ContentTemplate>
    </asp:UpdatePanel>





</asp:Content>

<asp:Content ID="Content6" ContentPlaceHolderID="cphTopContent" runat="server"></asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="cphMain" runat="server">

    <asp:UpdatePanel ID="upMain" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <table id="Table3" class="tbl-params" border="0" cellpadding="2" cellspacing="2">
            <tr>
                <td style="text-align:left; vertical-align:top;">
                    <asp:Label ID="label1" runat="server" Text="Nro Documento: " />
                    <asp:TextBox ID="txtNumPedido" runat="server" Text="" CssClass="inputbox" Width="200" MaxLength="10" />
                    <asp:HiddenField ID="hidDescuentoTotal" runat="server"/>
                    <cc1:FilteredTextBoxExtender ID="fteNumPedido" runat="server" TargetControlID="txtNumPedido" FilterType="Numbers" />
                </td>
                <td style="text-align:right; vertical-align:top;">
                    <asp:Label ID="label3" runat="server" Text="Clase Documento: " />
                    <asp:DropDownList ID="cmbTipoDocumento" runat="server" Width="200px" 
                        AutoPostBack="True" 
                        onselectedindexchanged="cmbTipoDocumento_SelectedIndexChanged" />
                </td>
            </tr>
        </table>

        <div style="height:10px">&nbsp;</div>

        <cc1:TabContainer ID="tcMain" runat="server" TabStripPlacement="Top" 
            ActiveTabIndex="0" Height="370px" Enabled="false">
            <cc1:TabPanel ID="tpCabecera" runat="server">
                <HeaderTemplate>Datos de Cliente</HeaderTemplate>
                <ContentTemplate>
                    <!-- Datos de Cabecera -->
                    <table id="htbParams" class="tbl-params" border="0" cellpadding="1" cellspacing="1" >
                        <script type="text/javascript" language="javascript">
                            function ismaxlength(objTxtCtrl, objLblCtrl) {
                                var nLength = 255;

                                if (objTxtCtrl.getAttribute && objTxtCtrl.value.length > nLength)
                                    objTxtCtrl.value = objTxtCtrl.value.substring(0, nLength)

                                if (document.all)
                                    document.getElementById(objLblCtrl).innerText = objTxtCtrl.value.length + ' de ' + nLength;
                                else
                                    document.getElementById(objLblCtrl).textContent = objTxtCtrl.value.length + ' de ' + nLength;
                            }

                            function getCodigo(source, eventArgs) {
                                var dir = eventArgs.get_text();
                                var n = dir.split("|");
                                //        n[0] => descripción
                                //        n[1] => dirección
                                //        n[2] => Teléfono
                                //        n[3] => Nif
                                //        n[4] => vend_code
                                //        n[5] => vend_text
                                $get('<%= txtCodCliente.ClientID %>').value = eventArgs.get_value();
                            }
                            function getCodNuevoMat(source, eventArgs) {
                                $get('<%= txtCodNuevoMat.ClientID %>').value = eventArgs.get_value();
                            }
                            function getCodigoSolicitante(source, eventArgs) {
                                $get('<%= txtCodSolicitante.ClientID %>').value = eventArgs.get_value();
                            }
                            function getCodigoDestMerc(source, eventArgs) {
                                $get('<%= txtCodDestMerc.ClientID %>').value = eventArgs.get_value();
                            }
                            function getCodigoDestFact(source, eventArgs) {
                                $get('<%= txtCodDestFact.ClientID %>').value = eventArgs.get_value();
                            }
                            function getCodigoResPago(source, eventArgs) {
                                $get('<%= txtCodResPago.ClientID %>').value = eventArgs.get_value();
                            }
                            function getCodigoEntFin(s, e) {
                                $get('<%= txtCodEntFinanciera.ClientID %>').value = e.get_value();
                            }

                            function getCodigoVendedor(s, e) {
                                $get('<%= txtCodVendedor1.ClientID %>').value = e.get_value();
                            }

                            function CerrarDialogoMedioPago() {
                                $find("mpeMedioPago").hide();
                            }


                            function CerrarDialogoCaracteristica() {
                                $find("mpeCaracteristica").hide();
                            }

                            function CerrarDialogoReenumerar() {
                                $find("mpeReenumerar").hide();
                            }

                            function mostrarImpresionTicket() {                            
                                window.open('Impresion/TicketPopup.aspx', '', 'width=300,height=750,top=50,left=150,status=no,resizable=no,scrollbars=yes', 'true');
                            }

                            function mostrarImpresionAnticipo() {
                                window.open('Impresion/AnticipoPopup.aspx', '', 'width=740,height=850,top=50,left=150,status=no,resizable=no,scrollbars=yes', 'true');
                            }

                            function CerrarDialogoImprimirDoc() {
                                $find("mpeImpresionDoc").hide();
                            }

                        </script>
                        <!-- ****************************************************** -->
                        <tr>
                            <td>&nbsp;</td>
                            <td>
                                <asp:Label ID="lblCodigoCliente" runat="server" Text="Código/NIF" Height="10px" />
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Label ID="lblRazonSocial" runat="server" Text="Razón Social"  />
                            </td>
                        </tr>
                        <tr>
                            <td style="vertical-align: top;">Cliente<br />
                                <asp:LinkButton ID="lnkShowPopUpInt" runat="server" Text="Datos de Cliente" />
                            </td>
                            <td>
                                <asp:TextBox ID="txtCodCliente" runat="server" CssClass="inputbox" MaxLength="11" AutoCompleteType="Company" Width="90px" 
                                    OnTextChanged="txtCodCliente_TextChanged" AutoPostBack="True" />
                                <cc1:FilteredTextBoxExtender ID="ftbeCodCliente" runat="server" TargetControlID="txtCodCliente" FilterType="Numbers" Enabled="True" />
                                <asp:TextBox ID="txtNomCliente" runat="server" CssClass="inputbox" 
                                    AutoCompleteType="Disabled" Width="200px" AutoPostBack="True" />
                                <cc1:AutoCompleteExtender ID="aceNomCliente" runat="server" TargetControlID="txtNomCliente" MinimumPrefixLength="1" CompletionInterval="100" CompletionSetCount="15"
                                    CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem"
                                    CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" DelimiterCharacters="" ServiceMethod="buscaClientes"
                                    OnClientItemSelected="getCodigo" Enabled="True" ServicePath="" />
                                <asp:TextBox ID="txtDirCliente" runat="server" CssClass="inputbox" AutoCompleteType="Disabled" Width="350px" ReadOnly="True" />

                                <asp:HiddenField ID="hfIndicadorCliente" runat="server" />
                                <asp:HiddenField ID="hfIndReferencia" runat="server" />

                            </td>
                        </tr>                            
                        <tr style="display:none;">
                            <td style="height:20px; vertical-align:middle;" colspan="2"><hr /></td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <table style="width:100%;">
                                    <tr>
                                        <td>
                                            <asp:LinkButton ID="lnkShowPopUpTextos" runat="server" Text="Textos" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td style="height:20px; vertical-align:middle;" colspan="2"><hr /></td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <table style="width:100%;">
                                    <tr>
                                        <td>
                                            <div id="divCondicionPago" runat="server" class="formcampo">
                                                <div class="formlabel">Pago</div>     
                                                <div class="formcontrol">                                       
                                                    <asp:DropDownList ID="cmbCondicionesPago" runat="server" Width="200px" />
                                                </div>
                                            </div>
                                            <div style="clear:both"></div>
                                            <div id="divTipoCambio" runat="server" class="formcampo"                                                >
                                                <div class="formlabel">Tipo Cambio</div>             
                                                <div class="formcontrol">                               
                                                    <asp:TextBox ID="txtTipoCambio" runat="server" CssClass="inputbox" Width="40px" MaxLength="6" ReadOnly="True" />                                            
                                                </div>
                                            </div>
                                            <div style="clear:both"></div>
                                            <div id="divPedidoCliente" runat="server" class="formcampo" >
                                                <div class="formlabel">Dcto. Gerencia </div>
                                                <div class="formcontrol">                                            
                                                    <asp:TextBox ID="txtNroPedCliente" runat="server" CssClass="inputbox" Width="100px" />                                            
                                                    <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" 
                                                        TargetControlID="txtNroPedCliente" FilterType="Custom, Numbers"
                                                    ValidChars="." Enabled="True" />
                                                </div>
                                            </div>
                                            <div style="clear:both"></div>
                                        </td>

                                        <td>
                                            <div id="divMoneda" runat="server" class="formcampo" >
                                                <div class="formlabel">Moneda</div>
                                                <div class="formcontrol">
                                                    <asp:DropDownList ID="cmbMoneda" runat="server" Width="70px"></asp:DropDownList>
                                                </div>
                                            </div>
                                            <div style="clear:both"></div>
                                            <div id="divFechaValidez" runat="server" class="formcampo">                                            
                                                <div class="formlabel">Fin Validez</div>    
                                                <div class="formcontrol">                                        
                                                    <asp:TextBox ID="txtFechaValidez" runat="server" Width="70px" CssClass="inputbox" Font-Size="10pt" ReadOnly="True" />
                                                </div>
                                            </div>
                                            <div style="clear:both"></div>
                                            <div id="divFechaPedido" runat="server" class="formcampo" >
                                                <div class="formlabel">Fecha Pedido</div>   
                                                <div class="formcontrol">                                         
                                                    <asp:TextBox ID="txtFecha" runat="server" CssClass="inputbox" Font-Size="10pt" Width="70px" ReadOnly="True" />
                                                </div>
                                            </div>
                                            <div style="clear:both"></div>
                                            
                                        </td>         
                                     </tr>                           
                                </table>
                            </td>
                        </tr>
                    </table>
                    <!-- ****************************************************** -->
                    <cc1:ModalPopupExtender ID="mpeInterlocutores" runat="server" TargetControlID="lnkShowPopUpInt"
                        PopupControlID="pnlInterlocutores" CancelControlID="btnClose"
                        BackgroundCssClass="modalBackground" PopupDragHandleControlID="pnlTitulo" 
                        DynamicServicePath="" Enabled="True" />

                    <asp:Panel ID="pnlInterlocutores" runat="server" ScrollBars="Auto" Width="780px" CssClass="modalPopup">
                        <asp:Panel ID="pnlTitulo" runat="server" Width="780px" BackColor="LightBlue" HorizontalAlign="Center">
                            <asp:Label ID="lblDetalleInterlocuroes" runat="server" Text="Detalle de Cliente" BackColor="LightBlue" Width="100%" />
                        </asp:Panel>

                        <table class="tbl-detalle">
                            <tr>
                                <th style="width:120px;">Func. interl.</th>
                                <th style="width:80px;">Interl.</th>
                                <th style="width:200px;">Nom.</th>
                                <th style="width:200px;">Calle</th>
                                <th style="width:80px;">Tel.</th>
                                <th style="width:80px;">NIF</th>
                            </tr>
                            <tr><td style="height:20px; vertical-align:middle;" colspan="8"><hr /></td></tr>
                            <tr>
                                <td style="text-align:left;">Solicitante</td>
                                <td style="text-align:left;">
                                    <asp:TextBox ID="txtCodSolicitante" runat="server" CssClass="inputbox" 
                                        MaxLength="10" AutoCompleteType="Company" Width="80px" ReadOnly="True" />
                                    <cc1:FilteredTextBoxExtender ID="ftbeCodSolicitante" runat="server" TargetControlID="txtCodSolicitante" FilterType="Numbers" Enabled="True" />
                                </td>
                                <td style="text-align:center;">
                                    <asp:TextBox ID="txtNomSolicitante" runat="server" CssClass="inputbox" AutoCompleteType="Disabled" Width="180px" ReadOnly="True" MaxLength="140" />
                                    <cc1:AutoCompleteExtender ID="aceNomSolicitante" runat="server" TargetControlID="txtNomSolicitante"
                                        MinimumPrefixLength="1" CompletionInterval="100" CompletionSetCount="15" CompletionListCssClass="autocomplete_completionListElement"
                                        CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                                        DelimiterCharacters="" ServiceMethod="buscaClientes" OnClientItemSelected="getCodigoSolicitante" Enabled="True" ServicePath=""></cc1:AutoCompleteExtender>
                                </td>
                                <td style="text-align:center;">
                                    <asp:TextBox ID="txtDirSolicitante" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"  Width="180px"  ReadOnly="True" MaxLength="60" />
                                </td>
                                <td style="text-align:center;vertical-align:top;width:80px;">
                                    <asp:TextBox ID="txtTelSolicitante" runat="server" CssClass="inputbox" AutoCompleteType="Disabled" Width="70px" ReadOnly="True" MaxLength="16" />
                                </td>
                                <!-- NIF Solicitante -->
                                <td style="text-align:left;">
                                    <asp:TextBox ID="txtNifSolicitante" runat="server" CssClass="inputbox" 
                                        MaxLength="11" Width="80px" />
                                    <cc1:FilteredTextBoxExtender ID="ftbeNifSolicitante" runat="server" TargetControlID="txtNifSolicitante" FilterType="Numbers" Enabled="True" />
                                </td>
                            </tr>
                            <tr>    
                                <td style="text-align:left;">Dest. Mcía.</td>
                                <td style="text-align:left;">
                                    <asp:TextBox ID="txtCodDestMerc" runat="server" CssClass="inputbox" MaxLength="10" AutoCompleteType="Company" Width="80px" />
                                </td>
                                <td style="text-align:center;">
                                    <asp:TextBox ID="txtNomDestMerc" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"  Width="180px"  MaxLength="140" />
                                    <cc1:AutoCompleteExtender ID="AutoCompleteExtender3" runat="server" TargetControlID="txtNomDestMerc"
                                        MinimumPrefixLength="1" CompletionInterval="100" CompletionSetCount="15"
                                        CompletionListCssClass="autocomplete_completionListElement"
                                        CompletionListItemCssClass="autocomplete_listItem"
                                        CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                                        DelimiterCharacters=""
                                        ServiceMethod="buscaClientes"
                                        OnClientItemSelected="getCodigoDestMerc" Enabled="True" ServicePath=""></cc1:AutoCompleteExtender>
                                </td>
                                <td style="text-align:center;">
                                    <asp:TextBox ID="txtDirDestMerc" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"  Width="180px"  MaxLength="60" />
                                </td>
                                <td style="text-align:center; vertical-align:top;width:80px;">
                                    <asp:TextBox ID="txtTelDestMerc" runat="server" CssClass="inputbox" AutoCompleteType="Disabled" Width="70px" MaxLength="16" />
                                </td>
                                <td style="text-align:left;">&nbsp;</td>
                            </tr>
                            <tr>
                                <td style="text-align:left;">Dest. Factura</td>
                                <td style="text-align:left;">
                                    <asp:TextBox ID="txtCodDestFact" runat="server" CssClass="inputbox" MaxLength="10" AutoCompleteType="Company" Width="80px" />
                                    <cc1:FilteredTextBoxExtender ID="ftbeCodDestFact" runat="server" TargetControlID="txtCodDestFact" FilterType="Numbers" Enabled="True" />
                                </td>
                                <td style="text-align:center;">
                                    <asp:TextBox ID="txtNomDestFact" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"  Width="180px"  MaxLength="140" />
                                    <cc1:AutoCompleteExtender ID="AutoCompleteExtender4" runat="server" TargetControlID="txtNomDestFact" MinimumPrefixLength="1" CompletionInterval="100" CompletionSetCount="15" CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" DelimiterCharacters="" ServiceMethod="buscaClientes" OnClientItemSelected="getCodigoDestFact" Enabled="True" ServicePath=""></cc1:AutoCompleteExtender>
                                </td>
                                <td style="text-align:center;">
                                    <asp:TextBox ID="txtDirDestFact" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"  Width="180px"  MaxLength="60" />
                                </td>
                                <td style="text-align:center; vertical-align:top;width:80px;">
                                    <asp:TextBox ID="txtTelDestFact" runat="server" CssClass="inputbox" AutoCompleteType="Disabled" Width="70px" MaxLength="16" />
                                </td>
                                <td style="text-align:left;">&nbsp;</td>
                            </tr>
                            <tr>
                                <td style="text-align:left;">Resp. Pago</td>
                                <td style="text-align:left;">
                                    <asp:TextBox ID="txtCodResPago" runat="server" CssClass="inputbox" MaxLength="10" AutoCompleteType="Company" Width="80px" />
                                    <cc1:FilteredTextBoxExtender ID="ftbeCodResPago" runat="server" TargetControlID="txtCodResPago" FilterType="Numbers" Enabled="True" />
                                </td>
                                <td style="text-align:center;">
                                    <asp:TextBox ID="txtNomResPago" runat="server" CssClass="inputbox" AutoCompleteType="Disabled" Width="180px"  MaxLength="140" />
                                    <cc1:AutoCompleteExtender ID="AutoCompleteExtender5" runat="server" TargetControlID="txtNomResPago"
                                        MinimumPrefixLength="1" CompletionInterval="100" CompletionSetCount="15"
                                        CompletionListCssClass="autocomplete_completionListElement"
                                        CompletionListItemCssClass="autocomplete_listItem"
                                        CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                                        DelimiterCharacters=""
                                        ServiceMethod="buscaClientes"
                                        OnClientItemSelected="getCodigoResPago" Enabled="True" ServicePath=""></cc1:AutoCompleteExtender>
                                </td>
                                <td style="text-align:center;">
                                    <asp:TextBox ID="txtDirResPago" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"  Width="180px"  MaxLength="60" />
                                </td>
                                <td style="text-align:center; vertical-align:top;width:80px;">
                                    <asp:TextBox ID="txtTelResPago" runat="server" CssClass="inputbox" AutoCompleteType="Disabled" Width="70px" MaxLength="16" />
                                </td>
                                <!-- NIF Resp Pago -->
                                <td style="text-align:left;">
                                    <asp:TextBox ID="txtNifResPago" runat="server" CssClass="inputbox" MaxLength="11" Width="80px" />
                                    <cc1:FilteredTextBoxExtender ID="ftbeNifResPago" runat="server" TargetControlID="txtNifResPago" FilterType="Numbers" Enabled="True" />
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align:left;">Ent. Financiera</td>
                                <td style="text-align:left;">
                                    <asp:TextBox ID="txtCodEntFinanciera" runat="server" CssClass="inputbox" MaxLength="10" AutoCompleteType="Company" Width="80px"
                                    OnTextChanged="txtCodEntFinanciera_TextChanged" AutoPostBack="True" />
                                    <cc1:FilteredTextBoxExtender ID="ftbeCodEntFin" runat="server" TargetControlID="txtCodEntFinanciera" FilterType="Numbers" Enabled="True" />
                                </td>        
                                <td style="text-align:center;">
                                    <asp:TextBox ID="txtNomEntFinanciera" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"  Width="180px"  MaxLength="140" />
                                    <cc1:AutoCompleteExtender ID="AutoCompleteExtender6" runat="server" TargetControlID="txtNomEntFinanciera"
                                        MinimumPrefixLength="1" CompletionInterval="100" CompletionSetCount="15"
                                        CompletionListCssClass="autocomplete_completionListElement"
                                        CompletionListItemCssClass="autocomplete_listItem"
                                        CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                                        DelimiterCharacters=""
                                        ServiceMethod="buscaEntFin"
                                        OnClientItemSelected="getCodigoEntFin" Enabled="True" ServicePath="" />
                                </td>
                                <td colspan="2">
                                
                                </td>
                                <td>
                                    <asp:CheckBox ID="chkRucDNI" runat="server" Text="DNI" />
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align:left;">Enc. Comercial</td>
                                <td style="text-align:left;">
                                    <asp:TextBox ID="txtCodVendedor1" runat="server" CssClass="inputbox" 
                                        MaxLength="10" AutoCompleteType="Company" Width="80px" ReadOnly="True" 
                                        ontextchanged="txtCodVendedor1_TextChanged" AutoPostBack="True" />
                                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txtCodVendedor1" FilterType="Numbers" Enabled="True" />
                                </td>
                                <td style="text-align:center;">
                                    <asp:TextBox ID="txtNomVendedor1" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"
                                     Width="180px"  ReadOnly="True" />
                                     <cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtNomVendedor1"
                                        MinimumPrefixLength="1" CompletionInterval="100" CompletionSetCount="15"
                                        CompletionListCssClass="autocomplete_completionListElement"
                                        CompletionListItemCssClass="autocomplete_listItem"
                                        CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                                        DelimiterCharacters=""
                                        ServiceMethod="buscaVendedor"
                                        OnClientItemSelected="getCodigoVendedor" Enabled="True" ServicePath="" />
                                </td>
                                <td colspan="1"; style="text-align:right;">
                                    Región:
                                </td>
                                 <td colspan="2">
                                    <asp:DropDownList ID="ddlRegion" runat="server" 
                                         onselectedindexchanged="ddlRegion_SelectedIndexChanged1" AutoPostBack="True"
                                         >

                                    </asp:DropDownList>
                                    </td>
                            </tr>
                            <tr>
                                <td style="text-align:left;">Gpo. Empresarial</td>
                                <td style="text-align:left;">
                                    <asp:TextBox ID="txtCodGpoEmp" runat="server" CssClass="inputbox" MaxLength="10" AutoCompleteType="Company" Width="80px" ReadOnly="True" />
                                </td>
                                <td style="text-align:center;"><asp:TextBox ID="txtNomGpoEmp" runat="server" CssClass="inputbox" 
                                    AutoCompleteType="Disabled"  Width="180px"  ReadOnly="True" />
                                </td>
                                <td colspan="1"; style="text-align:right;">
                                    Población:
                                </td>
                                 <td colspan="2">
                                    <asp:DropDownList ID="ddlPoblacion" runat="server" onselectedindexchanged="ddlPoblacion_SelectedIndexChanged1"  AutoPostBack="True">
                                    </asp:DropDownList>
                                    </td>
                            </tr>
                            <tr>
                                <td style="text-align:left;">Institucion</td>
                                <td style="text-align:left;">
                                    <asp:TextBox ID="txtCodInstitucion" runat="server" CssClass="inputbox" 
                                    MaxLength="10" AutoCompleteType="Company" Width="80px" ReadOnly="True" />
                                </td>
                                <td style="text-align:center;"><asp:TextBox ID="txtNomInstitucion" runat="server" CssClass="inputbox" 
                                    AutoCompleteType="Disabled"  Width="180px"  ReadOnly="True" />
                                </td>
                                <td colspan="3">&nbsp;</td>
                            </tr>                               
                        </table>
                        <div style="width:100%; text-align:right; padding-top:5px;">
                            <asp:ImageButton ID="btnClose" runat="server" ImageUrl="~/img/ok16.png" 
                                ImageAlign="Middle" onclick="btnClose_Click" />
                        </div>
                    </asp:Panel>

                    <cc1:ModalPopupExtender ID="mpeTextos" runat="server" TargetControlID="lnkShowPopUpTextos" PopupControlID="pnlTextos" CancelControlID="btnCloseTextos"
                        BackgroundCssClass="modalBackground" PopupDragHandleControlID="pnlTituloTextos" DynamicServicePath="" Enabled="True" />

                    <asp:Panel ID="pnlTextos" runat="server" ScrollBars="Auto" Width="770px" CssClass="modalPopup">
                        <asp:Panel ID="pnlTituloTextos" runat="server" Width="770px" BackColor="LightBlue" HorizontalAlign="Center">
                            <asp:Label ID="Label2" runat="server" Text="Detalle de Textos" BackColor="LightBlue" Width="100%" />
                        </asp:Panel>

                        <cc1:TabContainer ID="tcTextos" runat="server" ActiveTabIndex="0" CssClass="">
                            <cc1:TabPanel ID="tpReferencia" runat="server" >
                                <HeaderTemplate>Referencia</HeaderTemplate>
                                <ContentTemplate>
                                    <asp:TextBox ID="txtTextoReferencia" runat="server" Columns="90" Rows="10" TextMode="MultiLine" />
                                </ContentTemplate>
                            </cc1:TabPanel>
                            <cc1:TabPanel ID="tpObservaciones" runat="server">
                                <HeaderTemplate>Observaciones</HeaderTemplate>
                                <ContentTemplate>
                                    <asp:TextBox ID="txtTextoObservaciones" runat="server" Columns="90" Rows="10" TextMode="MultiLine" />
                                </ContentTemplate>
                            </cc1:TabPanel>
                            <cc1:TabPanel ID="tpGlosa" runat="server" >
                                <HeaderTemplate>Glosa</HeaderTemplate>
                                <ContentTemplate>
                                    <asp:TextBox ID="txtTextoGlosa" runat="server" Columns="90" Rows="10" TextMode="MultiLine" />
                                </ContentTemplate>
                            </cc1:TabPanel>
                            <cc1:TabPanel ID="tpAprob" runat="server" >
                                <HeaderTemplate>Aprob. Mostrador</HeaderTemplate>
                                <ContentTemplate>
                                    <asp:TextBox ID="txtTextoAprob" runat="server" Columns="90" Rows="10" TextMode="MultiLine" />
                                </ContentTemplate>
                            </cc1:TabPanel>
                            <cc1:TabPanel ID="tpGerencia" runat="server" >
                                <HeaderTemplate>Glosa</HeaderTemplate>
                                <ContentTemplate>
                                    <asp:TextBox ID="txtTextoGerencia" runat="server" Columns="90" Rows="10" TextMode="MultiLine" />
                                </ContentTemplate>
                            </cc1:TabPanel>
                            <cc1:TabPanel ID="tbAnticipo" runat="server" >
                                <HeaderTemplate>Anticipo</HeaderTemplate>
                                <ContentTemplate>
                                    <asp:TextBox ID="txtTextoAnticipo" runat="server" Columns="90" Rows="10" TextMode="MultiLine" />
                                </ContentTemplate>
                            </cc1:TabPanel>
                        </cc1:TabContainer>

                        <div style="width:100%; text-align:right; padding-top:5px;">
                            <asp:ImageButton ID="btnCloseTextos" runat="server" ImageUrl="~/img/ok16.png" ImageAlign="Middle" />
                        </div>
                    </asp:Panel>
                </ContentTemplate>
            </cc1:TabPanel>

            <cc1:TabPanel ID="tpDetalle" runat="server">
                <HeaderTemplate>Ingresar Materiales</HeaderTemplate>
                <ContentTemplate>
                    <script type="text/javascript">
                        function calendarShown(sender, args) {
                            sender._popupBehavior._element.style.zIndex = 99999999;
                        }
                    </script>

                    <!-- Datos de Detalle -->
                    <cc2:CoolGridView ID="cgvMateriales" runat="server" CssClass="tbl-detalle"  AutoGenerateColumns="False" GridLines="None" AllowResizeColumn="False" 
                            Height="260px" Width="100%"  OnRowDataBound="cgvMateriales_RowDataBound" OnRowCommand="cgvMateriales_RowCommand" OnPreRender="cgvMateriales_PreRender" DefaultColumnWidth="950px" >
                        <BoundaryStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px"  />
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <table style="table-layout:fixed; width:950px; border:0;">
                                        <tr>
                                            <th style="width:30px;"><img src="img/del.png" alt="Del" title="Borrar" /></th>
                                            <th style="width:30px;">Pos.</th>
                                            <th style="width:140px;">Material</th>
                                            <th style="width:250px;">Denominación</th>
                                            <th style="width:70px;">Cantidad</th>
                                            <th style="width:30px;" runat="server" id="thHeadUM">UM</th>
                                            <th style="width:75px;">Precio</th>
                                            <th style="width:75px;" runat="server" id="thDscto" visible='<%# (Session["IndAnticipo"]== "S")?false:true %>'>Dcto.</th>
                                            <th style="width:80px;">Total</th>
                                            <th style="width:170px;" runat="server" id="thHeadMR" visible='<%# (Session["IndAnticipo"]== "S" || Session["IndCotizacion"]== "S")?false:true %>'>Motiv.Rechazo</th>
                                            <th style="width:170px;" runat="server" id="tdDetalle" visible='<%# (Session["IndAnticipo"]== "S")?true:false %>'>Det Anticipo</th>
                                        </tr>
                                    </table>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <table style="table-layout:fixed; width:890px; border:0;">
                                        <tr>
                                            <td id="tcChkBorrar" runat="server" style="text-align:center;width:30px;">
                                                <asp:CheckBox ID="chkBorrar" runat="server" ToolTip='<%# Bind("Posicion") %>' />
                                                <asp:HiddenField ID="hidPosicion" runat="server" Value='<%# Bind("Posicion") %>' />
                                                <asp:HiddenField ID="hidLote" runat="server" Value='<%# Bind("CodLote") %>' />
                                                <asp:HiddenField ID="hidStatus" runat="server" Value='<%# Bind("codstatus") %>' />
                                              
                                            </td>
                                            <td style="text-align:right;width:30px;">
                                                <asp:Label ID="lblPosicion" runat="server" Text='<%# Bind("PosicionCorto") %>' />                                                 
                                            </td>
                                            <td style="text-align:center;width:140px;">
                                                <asp:LinkButton ID="lnkCodMaterial" ToolTip="Ver características" CommandName="Caracteristica" runat="server" 
                                                Text='<%# Bind("CodMaterialCorto") %>' CommandArgument='<%# ((GridViewRow) Container).RowIndex %>' />
                                            </td>
                                            <td style="width:250px;">
                                                <asp:HiddenField ID="hidMaterialId" runat="server" Value='<%# Bind("CodMaterial") %>' />
                                                <asp:TextBox ID="lblDescMaterial" MaxLength="40" runat="server" Text='<%# Bind("DescMaterial") %>'                                                        
                                                    ToolTip='<%# Bind("CodMaterial") %>' Width="300px"></asp:TextBox>
                                            </td>
                                            <td style="text-align:center;width:70px;">
                                                <cc1:FilteredTextBoxExtender ID="ftbeCantidad" TargetControlID="txtCantidad" FilterType="Custom,Numbers" ValidChars=".," runat="server" />
                                                <asp:TextBox ID="txtCantidad" MaxLength="8" 
                                                Text='<%# DataBinder.Eval(Container.DataItem, "Cantidad","{0:n3}") %>' 
                                                runat="server" CssClass="inputbox-number" Width="50" />
                                            </td>
                                            <td style="text-align:center;width:30px;" runat="server" id="tdRowUM">
                                                <asp:Label ID="lblUMedida" runat="server" Text='<%# Bind("CodUMedida") %>' ToolTip='<%# Bind("Peso") %>' />
                                                <asp:HiddenField ID="hidPeso" runat="server" Value='<%# Bind("Peso") %>' />
                                            </td>
                                            <td style="text-align:right;width:75px;">
                                                <asp:Label ID="lblPrecioItem" runat="server" visible='<%# (Session["IndAnticipo"]== "S")?false:true %>' Text=' <%# DataBinder.Eval(Container.DataItem, "PrecioUnitario","{0:n2}") %>'></asp:Label>
                                                <asp:TextBox ID="txtPrecio" runat="server"  visible='<%# (Session["IndAnticipo"]== "S")?true:false %>'  Text=' <%# DataBinder.Eval(Container.DataItem, "PrecioUnitario","{0:n2}") %>'></asp:TextBox>
                                            </td>
                                            <td style="text-align:right; width:75px;" runat="server" id="tdDscto" visible='<%# (Session["IndAnticipo"]== "S")?false:true %>'>
                                                <asp:LinkButton ID="lnkDctoTotal" runat="server" 
                                                Text='<%# DataBinder.Eval(Container.DataItem, "TotalDctos","{0:n2}") %>'/>
                                            </td>
                                            <td style="text-align:right; width:80px; padding-right: 5px;">
                                                <asp:Label ID="lblSubTotalItem" runat="server" Text=' <%# DataBinder.Eval(Container.DataItem, "SubTotal","{0:n2}") %>'></asp:Label>
                                            </td>
                                            <td style="text-align:right; width:170px;" runat="server" id="tdRowMR" visible='<%# (Session["IndAnticipo"]== "S" || Session["IndCotizacion"]== "S")?false:true %>'>
                                                <asp:DropDownList ID="cmbMotivoRechazo" runat="server" />
                                            </td>
                                            <td style="text-align:right; width:170px;" runat="server" id="tdRowDetalle" visible='<%# (Session["IndAnticipo"]== "S")?true:false %>'>
                                                 <asp:TextBox ID="txtDetalle" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                    </table>
                                    <!--------------------------------------------->
                                    <cc1:ModalPopupExtender ID="mpeDctoTotal" runat="server" TargetControlID="lnkDctoTotal" PopupControlID="pnlDctoTotal" Y="160"
                                        BackgroundCssClass="modalBackground" PopupDragHandleControlID="pnlTituloDctoTotal" />
                                    <asp:Panel ID="pnlDctoTotal" runat="server" ScrollBars="Auto" Width="450px" CssClass="modalPopup"  style="display:none">
                                        <asp:Panel ID="pnlTituloDctoTotal" runat="server" Width="450px" BackColor="lightblue" BorderColor="#6289AE" HorizontalAlign="Center">
                                            <asp:Label ID="lblTituloDctoTotal" runat="server" Text="Detalle de Descuentos" Width="100%" />
                                        </asp:Panel>
                                        

                                        <%--Tabla dinámica de condiciones--%>
                                        <table id="tblDescuentos" runat="server" cellpadding="2" cellspacing="2" class="tbl-descuentos" visible="false">
                                        </table>
                                        <%--Fin de la tabla--%>

                                        <asp:GridView ID="gvDescuento" runat="server" Width="450px" CssClass="tbl-stock" AutoGenerateColumns="false" >

                                        <Columns>
                                            <asp:TemplateField HeaderText="Denominación">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblDenominacion" runat="server" Text=""></asp:Label>
                                                    <asp:HiddenField ID="hfClaseCondicion" runat="server" Value='<%# Bind("ClaseCondicion") %>' />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Importe" ItemStyle-HorizontalAlign="Right">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txtImporte" runat="server" Width="60px"></asp:TextBox>
                                                    <cc1:FilteredTextBoxExtender ID="fteImporte" runat="server" TargetControlID="txtImporte" 
                                                    ValidChars="0123456789,." FilterType="Custom"></cc1:FilteredTextBoxExtender>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Valor" ItemStyle-HorizontalAlign="Right">
                                                <ItemTemplate>
                                                     <asp:Label ID="lblValor" runat="server" Text=""></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Máximo" ItemStyle-HorizontalAlign="Right">
                                                <ItemTemplate>
                                                     <asp:Label ID="lblMaximo" runat="server" Text=""></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                        </asp:GridView>

                                        <br />

                                        <table cellpadding="2" cellspacing="2" class="tbl-descuentos">
                                            <tr>
                                                <td>Precio Bruto:</td>
                                                <td class="importe">
                                                    <asp:Label ID="lblPrecioUnitario" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "PrecioUnitario","{0:n2}") %>' />
                                                </td>
                                                <td class="valor">
                                                    <asp:Label ID="lblPrecio" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "PrecioTotal","{0:n2}") %>' />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>Total Dctos/Recargos:</td>
                                                <td class="importe"> &nbsp;</td>
                                                <td class="valor">
                                                    <asp:Label ID="lblTotalDctos" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "TotalDctos","{0:n2}") %>' />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="height:10px; vertical-align:bottom;" colspan="4"><hr /></td>
                                            </tr>
                                            <tr>
                                                <td>Precio de Venta:</td>
                                                <td class="importe">&nbsp;</td>
                                                <td class="valor">
                                                    <asp:Label ID="lblPrecioNeto" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SubTotal","{0:n2}") %>' />
                                                </td>
                                            </tr>
                                        </table>

                                        <div style="width:100%; text-align:right; padding-top:5px;">
                                            <asp:ImageButton ID="ibtnCloseDctoTotal" runat="server" ImageUrl="~/img/ok16.png" ImageAlign="Middle" OnClick="ibtnCloseDctoTotal_Click" />
                                        </div>
                                    </asp:Panel>
                                <!--------------------------------------------->
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </cc2:CoolGridView>

                    <table style="table-layout:fixed; width:500px; border:0;">
                        <tr>
                            <td style="width:20px;">&nbsp;</td>
                            <td style="width:20px;">&nbsp;</td>
                            <td style="width:120px;">Código</td>
                            <td style="width:300px;">Descripción</td>
                            <td style="width:70px;"> Cantidad </td>
                        </tr>
                        <tr>
                            <td style="width:20px;"><asp:ImageButton ID="ibtnAddNuevoMat"  runat="server" ImageAlign="Middle" ImageUrl="~/img/add.png" AlternateText="Add" ToolTip="Añadir" OnClick="ibtnAddNuevoMat_Click" /></td>
                            <td style="width:20px;">&nbsp;</td>
                            <td style="width:120px;">
                                <asp:TextBox ID="txtCodNuevoMat" runat="server" CssClass="inputbox" Width="110px" />
                            </td>
                            <td style="width:300px;">
                                <asp:TextBox ID="txtDescNuevoMat" runat="server" CssClass="inputbox" Width="290px" />
                                <cc1:AutoCompleteExtender ID="aceNuevoMat" runat="server" 
                                        TargetControlID="txtDescNuevoMat" CompletionInterval="100" CompletionSetCount="5"
                                        CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem"
                                        CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" DelimiterCharacters="" ServiceMethod="buscaMateriales"
                                        OnClientItemSelected="getCodNuevoMat" Enabled="True" ServicePath="" />
                            </td>
                            <td style="width:70px;">
                                <asp:TextBox ID="txtCantNuevoMat" runat="server" CssClass="inputbox" Width="50px" />
                                <cc1:FilteredTextBoxExtender ID="fteCantNuevoMat" TargetControlID="txtCantNuevoMat" 
                                        FilterType="Custom, Numbers" ValidChars=".," runat="server" Enabled="True" />
                            </td>
                            <td style="width:390px;" />
                        </tr>
                    </table>

                    <asp:LinkButton ID="lnkAddItems" runat="server" Text="Buscar materiales..." ToolTip="Click aqui para añadir materiales" OnClick="lnkAddItems_Click" />
                </ContentTemplate>
            </cc1:TabPanel>
        </cc1:TabContainer>

        <div style="height:15px">
            <asp:Label ID="lblMensajeTC" runat="server" Font-Italic="true" Font-Size="10px" />
        </div>
        <div style="float: left;"></div>
        <div id="divSubTotalPedido">
        <table id="Table1" class="tbl-subtotal" cellpadding="2" cellspacing="2" >
        <tr><td>Total <asp:Label ID="lblSimbTotal" Text="" runat="server" /></td> <td style="text-align:right;">
        <asp:TextBox ID="txtTotal" CssClass="inputbox-number" ReadOnly="true" Width="70" Text="0.00" runat="server"></asp:TextBox>
        </td>
        </tr>
        </table>
        </div>
        <%--<div id="divSubTotalPedido">
            <table id="Table1" class="tbl-subtotal" cellpadding="2" cellspacing="2" >
                <tr>
                    <td>Medio de Pago:</td>
                    <td>
                        <asp:DropDownList ID="ddlMedioPago" runat="server" AutoPostBack="true" 
                            onselectedindexchanged="ddlMedioPago_SelectedIndexChanged">
                            <asp:ListItem Value="" Text="-Seleccione-" ></asp:ListItem>
                            <asp:ListItem Value="02" Text="EFECTIVO"></asp:ListItem>
                            <asp:ListItem Value="03" Text="CHEQUE"></asp:ListItem>
                            <asp:ListItem Value="04" Text="TARJETA"></asp:ListItem>
                            <asp:ListItem Value="05" Text="VOUCHER"></asp:ListItem>
                        </asp:DropDownList>
                    </td>                   
                </tr>
                <tr>
                    <td>Monto:</td>
                    <td>
                        <asp:TextBox ID="txtMontoMedioPago" runat="server"></asp:TextBox>                       
                    </td>                   
                </tr>
                  <tr>
                    <td>Moneda:</td>
                    <td>
                        <asp:DropDownList ID="ddlMonedaMedioPago" runat="server">
                            <asp:ListItem Value="" Text="-Seleccione-" ></asp:ListItem>
                            <asp:ListItem Value="USD" Text="DÓLARES"></asp:ListItem>
                            <asp:ListItem Value="PEN" Text="SOLES"></asp:ListItem>
                        </asp:DropDownList>
                    </td>                   
                </tr>
            </table>                  
            <br style="clear:both" />

            <table style="width:100%;">
                <tr runat="server" id="trTarjeta" visible="false">    
                    <td>Operador:</td>
                    <td>
                        <asp:DropDownList ID="ddlOperador" runat="server">
                            <asp:ListItem Text="-Seleccione-" Value=""></asp:ListItem>                            
                        </asp:DropDownList>
                    <td>Total <asp:Label ID="lblSimbTotal" Text="" runat="server" /></td>
                    <td style="text-align:right;">
                        <asp:TextBox ID="txtTotal" CssClass="inputbox-number" ReadOnly="true" Width="70" Text="0.00" runat="server"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </div>--%>
    </ContentTemplate>
</asp:UpdatePanel>

    <!-- Modal de medidos de pago -->
    <asp:Panel ID="pnlMedioPago" runat="server" ScrollBars="Auto" Width="800px" CssClass="modalPopup" style="display:none">
        <asp:Panel ID="pnlMoveMedioPago" runat="server" CssClass="tit-pago-modal">
            Detalle de Pedido
        </asp:Panel>   
          
        <asp:UpdatePanel ID="upMedioPago" runat="server">
            <ContentTemplate>                  
               <!-- aqui insertar el popup-->                
                <uc1:PagoControl ID="pagoControl" runat="server" />                
            </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Panel>

    <asp:HiddenField ID="hfMedioPago" runat="server" />
    <cc1:ModalPopupExtender ID="mpeMedioPago" runat="server" TargetControlID="hfMedioPago" BehaviorID="mpeMedioPago"
            PopupControlID="pnlMedioPago"  BackgroundCssClass="modalBackground" 
            PopupDragHandleControlID="pnlMoveMedioPago" >
    </cc1:ModalPopupExtender>
    <!-- fin de modal -->

    <!-- Modal de medidos de pago -->
    <asp:Panel ID="PanelValidacionStock" runat="server" ScrollBars="Auto" Width="750px" CssClass="modalPopup" style="display:none">
        <asp:Panel ID="Panel2" runat="server" CssClass="tit-pago-modal">
            Visualización de Stock
        </asp:Panel>   
          
        <asp:UpdatePanel ID="UpdatePanel3" runat="server">
            <ContentTemplate>
                <div>
                    <div style="text-align:center">
                        <asp:GridView ID="GridViewVisualizacionStock" runat="server" AutoGenerateColumns="false">
                            <Columns>
                                <asp:BoundField DataField="posicion" HeaderText="Posición" ItemStyle-Font-Size="Small" />
                                <asp:BoundField DataField="codigoMaterial" HeaderText="Código Material" ItemStyle-Font-Size="Small"/>
                                <asp:BoundField DataField="descripcionMaterial" HeaderText="Descripción Material" ItemStyle-Font-Size="Small"/>
                                <asp:BoundField DataField="estado" HeaderText="Estado" ItemStyle-Font-Size="Small"/>
                                <asp:BoundField DataField="cantidadPedido" HeaderText="Cant. Pedido" ItemStyle-Font-Size="Small"/>
                                <asp:BoundField DataField="cantidadConfirmada" HeaderText="Cant. Solicitada" ItemStyle-Font-Size="Small"/>
                            </Columns>
                        </asp:GridView>
                    </div>
                    <div style="float:right;">
                        <asp:ImageButton ID="ibtnVisualizacionStock" runat="server" ImageUrl="~/img/ok16.png" 
                            ImageAlign="Middle" onclick="ibtnVisualizacionStock_Click"/>
                    </div>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Panel>
    <asp:HiddenField ID="hfVisualizacionStock" runat="server" />
    <cc1:ModalPopupExtender ID="mpeVisualizacionStock" runat="server" TargetControlID="hfVisualizacionStock" BehaviorID="mpeVisualizacionStock"
            PopupControlID="PanelValidacionStock"  BackgroundCssClass="modalBackground" 
            PopupDragHandleControlID="Panel2" >
    </cc1:ModalPopupExtender>
    <!-- fin de modal -->
    
   <!-- Modal de medidos de pago -->
    <asp:Panel ID="pnlCaracteristica" runat="server" ScrollBars="Auto" Width="750px" CssClass="modalPopup" style="display:none">
        <asp:Panel ID="pnlMoveCaracteristica" runat="server" Width="100%" BackColor="lightblue" BorderColor="#6289AE" HorizontalAlign="Center">
            <asp:Label ID="lblTitCaracteristica" runat="server" Text="Características del vehículo" Width="100%" />
        </asp:Panel>   
          
        <asp:UpdatePanel ID="upCaracteristica" runat="server">
            <ContentTemplate>   
                <table style="width:100%;">
                     <tr>
                        <td>Modelo de Motor</td>
                        <td><asp:TextBox ID="txtCModeloMotor" runat="server" Enabled="false"></asp:TextBox></td>                         
                        <td>Longitud</td>
                        <td><asp:TextBox ID="txtCLongitud" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                      <tr>
                        <td>Marca de Motor</td>
                        <td><asp:TextBox ID="txtCMarcaMotor" runat="server" Enabled="false"></asp:TextBox></td>     
                        <td>Ejes</td>
                        <td><asp:TextBox ID="txtCEjes" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                      <tr>
                        <td>Color</td>
                        <td>
                            <asp:DropDownList ID="ddlCColor" runat="server">
                            </asp:DropDownList>
                        </td>     
                        <td>Ancho</td>
                        <td><asp:TextBox ID="txtCAncho" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                      <tr>
                        <td>Tipo de carroceria</td>
                        <td><asp:TextBox ID="txtCTipoCarroceria" runat="server" Enabled="false"></asp:TextBox></td>     
                        <td>Altura</td>
                        <td><asp:TextBox ID="txtCAltura" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                      <tr>
                        <td>Año de fabricación</td>
                        <td><asp:TextBox ID="txtCAnioFabricacion" runat="server" Enabled="true"></asp:TextBox></td>     
                        <td>Combustible</td>
                        <td><asp:TextBox ID="txtCCombustible" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                     <tr>
                        <td>Cilindros</td>
                        <td><asp:TextBox ID="txtCCilindros" runat="server" Enabled="false"></asp:TextBox></td>     
                        <td>Peso bruto</td>
                        <td><asp:TextBox ID="txtCPesoBruto" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                      <tr>
                        <td>Año de modelo</td>
                        <td><asp:TextBox ID="txtCAnioModelo" runat="server" Enabled="true"></asp:TextBox></td>     
                        <td>Peso neto</td>
                        <td><asp:TextBox ID="txtCPesoNeto" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                      <tr>
                        <td>Fórmula rodante</td>
                        <td><asp:TextBox ID="txtCFormulaRodante" runat="server" Enabled="false"></asp:TextBox></td>     
                        <td>Modelo de alternador</td>
                        <td><asp:TextBox ID="txtCModeloAlternador" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                      <tr>
                        <td>Transmisión</td>
                        <td><asp:TextBox ID="txtCTransmision" runat="server" Enabled="false"></asp:TextBox></td>     
                        <td>Regulador</td>
                        <td><asp:TextBox ID="txtCRegulador" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                      <tr>
                        <td>Potencia continua</td>
                        <td><asp:TextBox ID="txtCPotenciaContinua" runat="server" Enabled="false"></asp:TextBox></td>     
                        <td>Voltaje alternador</td>
                        <td><asp:TextBox ID="txtCVoltajeAlternador" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                     <tr>
                        <td>Potencia emergencia</td>
                        <td><asp:TextBox ID="txtCPotenciaEmergencia" runat="server" Enabled="false"></asp:TextBox></td>     
                        <td>Categoría</td>
                        <td><asp:TextBox ID="txtCCategoria" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                      <tr>
                        <td>Versión</td>
                        <td><asp:TextBox ID="txtCVersion" runat="server" Enabled="false"></asp:TextBox></td>     
                        <td>Potencia de motor</td>
                        <td><asp:TextBox ID="txtCPotenciaMotor" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                      <tr>
                        <td>Cilindrada</td>
                        <td><asp:TextBox ID="txtCCilindrada" runat="server" Enabled="false"></asp:TextBox></td>     
                        <td>Carga útil</td>
                        <td><asp:TextBox ID="txtCCargaUtil" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                      <tr>
                        <td>Número de ruedas</td>
                        <td><asp:TextBox ID="txtCNumeroRuedas" runat="server" Enabled="false"></asp:TextBox></td>     
                        <td>Número de pasajeros</td>
                        <td><asp:TextBox ID="txtCNumeroPasajero" runat="server" Enabled="false"></asp:TextBox></td>     
                     </tr>
                      <tr>
                        <td>Número de asientos</td>
                        <td><asp:TextBox ID="txtCNumeroAsiento" runat="server" Enabled="false"></asp:TextBox></td>     
                        <td></td>
                        <td></td>
                     </tr>

                    
                </table>       
                <asp:HiddenField ID="hfCodMaterial" runat="server" />  
                <asp:HiddenField ID="hfCodPosicion" runat="server" />  
                               
                <br style="clear:both" />
                <div style="width:100%; text-align:right; padding-top:5px;">
                    <asp:ImageButton ID="btnAceptarCaracteristica" runat="server" ImageUrl="~/img/ok16.png" 
                        ImageAlign="Middle" onclick="btnAceptarCaracteristica_Click"  />
                    <asp:ImageButton ID="btnCerrarCaracteristica" 
                        OnClientClick="CerrarDialogoCaracteristica();" runat="server" 
                        ImageUrl="~/img/cancel16.png" ImageAlign="Middle" 
                        onclick="btnCerrarCaracteristica_Click" />
                </div>

                <div style="clear:both"></div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Panel>

    <asp:HiddenField ID="hfCaracteristica" runat="server" />
    <cc1:ModalPopupExtender ID="mpeCaracteristica" runat="server" TargetControlID="hfCaracteristica" BehaviorID="mpeCaracteristica"
            PopupControlID="pnlCaracteristica"  BackgroundCssClass="modalBackground" 
            PopupDragHandleControlID="pnlMoveCaracteristica" >
    </cc1:ModalPopupExtender>
    <!-- fin de modal -->



    <!-- modal para reimpresion -->

       <asp:Panel ID="pnlReenumerar" runat="server" ScrollBars="Auto" Width="500px" CssClass="modalPopup" style="display:none">
        <asp:Panel ID="pnlMoveReenumerar" runat="server" Width="100%" BackColor="lightblue" BorderColor="#6289AE" HorizontalAlign="Center">
            <asp:Label ID="lblTitReenumerar" runat="server" Text="Medios de Pago" Width="100%" />
        </asp:Panel>   
          
        <asp:UpdatePanel ID="upReenumerar" runat="server">
            <ContentTemplate>   
                
                <table style="width:450px" cellspacing="0" cellpadding="0">
                <tr style="visibility:hidden;">
                    <td>Tipo documento:</td>
                    <td>
                        <asp:DropDownList ID="ddltipodoc" runat="server" Height="18px" Width="140px"
                         OnSelectedIndexChanged="ddltipodoc_SelectedIndexChanged"
                         AutoPostBack="true">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>Folio antiguo:</td>
                    <td>
                        <asp:TextBox ID="txtoldfijo" runat="server" CssClass="inputbox" Width="60" Enabled="false" />-
                        <asp:TextBox ID="txtold" runat="server" CssClass="inputbox" Width="100px" Enabled="false"/>
                     </td>
                </tr>
                <tr>
                    <td>Folio nuevo:</td>
                    <td>
                        <asp:TextBox ID="txtnewfijo" runat="server" CssClass="inputbox" Width="60" Enabled="false" />-
                        <asp:TextBox ID="txtnew" runat="server" CssClass="inputbox" Width="100px" />
                     </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Label ID="lblResult" runat="server" Text=""></asp:Label>
                    </td>
                </tr>          
            </table>

                <br style="clear:both" />
                <div style="width:100%; text-align:right; padding-top:5px;">
                    <asp:ImageButton ID="btnGuardarReenumerar" runat="server" ImageUrl="~/img/ok16.png" 
                        ImageAlign="Middle" onclick="btnGuardarReenumerar_Click"  />
                    <asp:ImageButton ID="btnCloseReenumerar" OnClientClick="CerrarDialogoReenumerar();" runat="server" ImageUrl="~/img/cancel16.png" ImageAlign="Middle" />
                </div>

                <div style="clear:both"></div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Panel>

    <asp:HiddenField ID="hfReenumerar" runat="server" />
    <cc1:ModalPopupExtender ID="mpeReenumerar" runat="server" TargetControlID="hfReenumerar" BehaviorID="mpeReenumerar"
            PopupControlID="pnlReenumerar"  BackgroundCssClass="modalBackground" 
            PopupDragHandleControlID="pnlMoveReenumerar" >
    </cc1:ModalPopupExtender>
    <!-- fin de modal -->



      <!-- Modal de medidos de pago -->
    <asp:Panel ID="pnlImpresionDoc" runat="server" ScrollBars="Auto" Width="300px" CssClass="modalPopup" style="display:none">
        <asp:Panel ID="pnlMoveImpresionDoc" runat="server" CssClass="tit-pago-modal">
            Imprimir documento
        </asp:Panel>   
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>  
        <br /> 
        <asp:Label ID="lblImpresionDoc" runat="server" Text=""></asp:Label>
         </ContentTemplate>
        </asp:UpdatePanel>
        <br style="clear:both" />
        <div style="width:100%; text-align:right; padding-top:5px;">
             <asp:ImageButton ID="btnImprimirDoc" runat="server" ImageUrl="~/img/ok16.png" 
                   ImageAlign="Middle" onclick="btnImprimirDoc_Click"  />
             <asp:ImageButton ID="btnCloseImprimirDoc" OnClientClick="CerrarDialogoImprimirDoc();" runat="server" 
                   ImageUrl="~/img/cancel16.png" ImageAlign="Middle" />
        </div>            
         
    </asp:Panel>

    <asp:HiddenField ID="hfImpresionDoc" runat="server" />
    <cc1:ModalPopupExtender ID="mpeImpresionDoc" runat="server" TargetControlID="hfImpresionDoc" BehaviorID="mpeImpresionDoc"
            PopupControlID="pnlImpresionDoc"  BackgroundCssClass="modalBackground" 
            PopupDragHandleControlID="pnlMoveImpresionDoc" >
    </cc1:ModalPopupExtender>
    <!-- fin de modal -->

           <asp:Panel ID="pnlImpresion" runat="server" ScrollBars="Auto" Width="300px" CssClass="modalPopup" style="display:none">
                <asp:Panel ID="pnlTituloImpresion" runat="server" Width="300px" BackColor="lightblue" BorderColor="#6289AE" HorizontalAlign="Center">
                    <asp:Label ID="lblTituloImpresion" runat="server" Text="Detalle de Impresión" Width="100%" />
                </asp:Panel>   
             
              <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>  
                        <table cellpadding="2" cellspacing="2" class="tbl-descuentos">
                        <tr>
                            <td style="font-size: 11px;">
                                 <asp:RadioButtonList ID="rblTiposImpresion" runat="server"> 
                                    <asp:ListItem Value="0" Text="Cotización" Selected="True" />             
                                    <asp:ListItem Value="1" Text="Oferta Simple VMS" />  
                                    <asp:ListItem Value="2" Text="Oferta Técnica VMS" />
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                        </table>

                        
                      
                <div style="width:100%; text-align:right; padding-top:5px;">
                    <asp:ImageButton ID="ibtnOkImpresion" runat="server" ImageUrl="~/img/ok16.png" ImageAlign="Middle" OnClick="btnImprimir_Click" />
                    <asp:ImageButton ID="ibtnCloseImpresion" runat="server" OnClientClick="cerrarDialogoImpresion();" ImageUrl="~/img/cancel16.png" ImageAlign="Middle" />
                </div>
                </ContentTemplate>
                        </asp:UpdatePanel>
            </asp:Panel>   
            <asp:HiddenField runat="server" ID="hfImpresion" />         
            <cc1:ModalPopupExtender ID="mpeImpresion" runat="server" TargetControlID="hfImpresion" BehaviorID="mpeImpresion" 
                 PopupControlID="pnlImpresion" BackgroundCssClass="modalBackground" 
                 PopupDragHandleControlID="pnlTituloImpresion" >
            </cc1:ModalPopupExtender>
           


</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="cphFooter" runat="server">
</asp:Content>
